<?php
    include_once('connect.php');

    $name = $_POST['id'];
    $comm = $_POST['comm'];

    $sql_id  = "SELECT use_id
                FROM user
                WHERE use_name like '".$name."'";
    $res_id = mysql_query($sql_id);
    $use_id = mysql_fetch_array(($res_id));

    $sql_insert =  "INSERT INTO comment(com_use_id,com_content)
                    VALUE(".$use_id['use_id'].",'".$comm."')";
    $res_insert = mysql_query($sql_insert);

    //if($res_insert != 0){
        $meseger['name'] = $name;
        $meseger['comm'] = $comm;
        exit(json_encode($meseger));
    //}
?>
